package com.base.cn.platform.os.dao.course.cou.buy;

import com.base.cn.platform.os.common.mybatis.BaseDao;
import com.base.cn.platform.os.entity.course.cou.buy.CourseBuyRecord;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 课程购买记录Dao
 *
 * @author s.li
 * @create 2018-05-17-14:40
 */
@Mapper
public interface CourseBuyRecordDao extends BaseDao<CourseBuyRecord> {
    /**
     * 查询用户购买记录去重
     * @param clazz
     * @param
     * @return
     */
    Page<CourseBuyRecord> findCourseBuyUserList(@Param("clazz") Class<CourseBuyRecord> clazz, @Param("params") CourseBuyRecord courseBuyRecord);

    /**
     * 获取用户最新的购买记录去重
     * @param clazz
     * @param courseBuyRecord
     * @return
     */
    Page<CourseBuyRecord> findCourseBuyRecordFrontPage(@Param("clazz") Class<CourseBuyRecord> clazz, @Param("params") CourseBuyRecord courseBuyRecord);

    /**
     * 查询用户购买记录去重
     * @param clazz
     * @param courseBuyRecord
     * @return
     */
    List<CourseBuyRecord> findCourseBuyRecordFront(@Param("clazz") Class<CourseBuyRecord> clazz, @Param("params") CourseBuyRecord courseBuyRecord);

    /**
     * 获取学员的科目
     * @param userId
     * @return
     */
    List<String> findUserSubjectByBuyCourse(@Param("userId") BigDecimal userId);

}
